/*
 * @Author: byron
 * @Date: 2021-10-28 12:52:05
 * @LastEditTime: 2021-12-11 17:16:02
 */
import { request } from '../http'
import qs from 'qs'

const api = {
    get: '/articles?page=1&pageSize=100',
    add: '/articles/publish',
    del: '/articles/delete',
    edit: '/article/editArticle',
}

export const getArticles = (name) => request.get(api.get, qs.stringify(name))
export const addArticles = (data) => request.post(api.add, data)
export const delArticle = (id) => request.delete(`${api.del}/${id}`)
export const editArticle = (id, data) =>
    request.put(`${api.edit}/${id}`, qs.stringify(data))
